package VisualComponent;
// 滚动条装饰类
public class ScrollBarDecorator extends ComponentDecorator {
    public ScrollBarDecorator(IComponent component) {
        super(component);
    }

    @Override
    public void display() {
        super.display(); // 先调用原始构件的显示方法
        addScrollBar(); // 添加滚动条效果
    }

    private void addScrollBar() {
        System.out.println("添加滚动条");
    }
}
